/*
 * @Description: 触发事件API
 * @Author: songlin
 * @Date: 2020-12-22 11:44:18
 * @LastEditTime: 2020-12-30 09:14:32
 * @LastEditors: songlin
 */
import request from '../../router/axios';

export function getProcessByObjectId(params) { // 查询单据的可视化流程
    return request({
        url: '/admin/sysvf/getForObject',
        method: 'get',
        params
    })
}
export function getProcessPhaseTask(params) { // 获取单据的阶段任务
    return request({
        url: '/admin/sysvfphasetaskobject/getPhaseTask',
        method: 'get',
        params
    })
}
export function getProcessPhaseInfo(params) { // 获取单据的关键信息
    return request({
        url: '/admin/sysvfphaseinfoobject/getPhaseInfo',
        method: 'get',
        params
    })
}
export function enableProcessPhaseTask(data) { // 选中可视化流程阶段任务
    return request({
        url: '/admin/sysvfphasetaskobject/select',
        method: 'post',
        data
    })
}
export function disableProcessPhaseTask(data) { // 取消选中可视化流程阶段任务
    return request({
        url: '/admin/sysvfphasetaskobject/deselect',
        method: 'post',
        data
    })
}

export function saveProcessPhaseInfo(data) { // 保存可视化流程阶段关键信息-单据关系表
    return request({
        url: '/admin/sysvfphaseinfoobject/save',
        method: 'post',
        data
    })
}
export function getNextProcessPhase(params) { // 根据vfId及phaseId查询该阶段可进行的下个阶段
    return request({
        url: '/admin/sysvfphaserule/listForNext',
        method: 'get',
        params
    })
}

export function saveProcessPhaseState(router, data) { // 保存可视化流程所选阶段状态-单据关系表
    return request({
        url: router + '/sysvfphasestateobject/save',
        method: 'post',
        data
    })
}